(function(){
	angular.module('app').factory('brandStatDataComponentService', brandStatDataComponentService);

	brandStatDataComponentService.$inject = ['util','$q'];

	function brandStatDataComponentService(util,$q){
		return {
			getBrandInfo: _getBrandInfo,
			getCatBrand:_getCatBrand
		}

		function _getBrandInfo(brand){

			var defer = $q.defer();

			util.$get({
				url: '/marketconditions/brand/getBrandDetail.htm',
				data:{
					brand:brand
				}
			}).then(function(resp){

				defer.resolve(resp.value);

			},function(err){

				defer.reject(err);

			});

			return defer.promise;

		}

		function _getCatBrand(brand){

			var defer = $q.defer();

			util.$get({
				url: '/marketconditions/brand/getCatBrandDetail.htm',
				data:{
					brand:brand
				}
			}).then(function(resp){

				defer.resolve(resp.value);

			},function(err){

				defer.reject(err);

			});

			return defer.promise;

		}
	}
})();